package org.example.service.impl;


import org.example.mapper.DepartmentMapper;
import org.example.mapper.EmployeeMapper;
import org.example.mapper.TalentsMapper;
import org.example.pojo.*;
import org.example.service.TalentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

@Service
public class TalentsServiceImpl implements TalentsService {

    @Autowired
    TalentsMapper talentsMapper;
    @Autowired
    EmployeeMapper employeeMapper;


    @Override
    public int isAddEntry(Integer id) {
        return talentsMapper.isAddEntry(id);
    }

    @Override
    public TalentsRegister isExistPhone(String phone) {
        return talentsMapper.isExistPhone(phone);
    }

    @Override
    public Boolean addEmployeeDep(Employee employee) {
        int i = employeeMapper.addEmployee(employee);


        return i>0;
    }

    @Override
    public TalentsListVO looktalentNamePhone(Integer id) {
        return talentsMapper.looktalentNamePhone(id);
    }

    @Override
    public boolean updateIsHire(Integer id, String remark, String status) {
        return talentsMapper.updateIsHire(id, remark, status)>0;
    }

    @Override
    public List<TalentsListLikeVO> showListTalentsListStatus(String like) {
        return talentsMapper.showListTalentsListStatus(like);
    }

    @Override
    public List<TalentsListVO> showListTalents( String like) {
        return talentsMapper.showListTalents(like);
    }


    @Override
    public Talents oneShowList(Integer id) {
        return talentsMapper.oneShowList(id);
    }

    @Override
    public boolean registerTalent(TalentsRegister talentsRegister) {
        return talentsMapper.registerTalent(talentsRegister)>0;
    }

    @Override
    public Talents passwordAndphoneLoginTalent(HashMap<String, String> map) {
        return talentsMapper.passwordAndphoneLoginTalent(map);
    }

    @Override
    public Talents showLoginAndPasswrod(Integer id) {
        return talentsMapper.showLoginAndPasswrod(id);
    }

    @Override
    public boolean updateTalentsRegister(HashMap<String, Object> map) {
        return talentsMapper.updateTalentsRegister(map)>0;
    }

    @Override
    public String selectPassWrod(Integer id) {
        return talentsMapper.selectPassWrod(id);
    }

    /**
     *更新其他数据
     */
    @Override
    public boolean addUpdateTalents(Talents talents) {
        return talentsMapper.addUpdateTalents(talents)>0;
    }


}
